package com.example.survey_determination.service.impl;


import com.example.survey_determination.dao.ReportedInfoDao;
import com.example.survey_determination.dao.SurveyLossInfoDao;
import com.example.survey_determination.dao.TaskInfoDao;
import com.example.survey_determination.dao.VerifyLossInfoDao;
import com.example.survey_determination.service.SurveyLossInfoService;

import entity.SurveyLossInfo;
import org.springframework.stereotype.Service;


import javax.annotation.Resource;
import java.util.List;

/**
 * (SurveyLossInfo)表服务实现类
 *
 * @author makejava
 * @since 2022-01-04 16:44:25
 */
@Service("surveyLossInfoService")
public class SurveyLossInfoServiceImpl implements SurveyLossInfoService {
    @Resource
    private SurveyLossInfoDao surveyLossInfoDao;
    @Resource
    private ReportedInfoDao reportedInfoDao;
    @Resource
    private VerifyLossInfoDao verifyLossInfoDao;
    @Resource
    private TaskInfoDao TaskInfoDao;
    /**
     * 通过ID查询单条数据
     *
     * @param surveylossid 主键
     * @return 实例对象
     */
    @Override
    public SurveyLossInfo queryById(Integer surveylossid) {
        return this.surveyLossInfoDao.queryById(surveylossid);
    }

    @Override
    public int insertSurveyLossInfo(SurveyLossInfo surveyLossInfo) {
        System.out.println(surveyLossInfo.getClaimmainid());
        this.TaskInfoDao.updateService_schedule2(surveyLossInfo.getClaimmainid());
        return this.surveyLossInfoDao.insertSurveyLossInfo(surveyLossInfo);
    }

    @Override
    public List<SurveyLossInfo> selectAll(Integer dispose_people_number) {
        List<SurveyLossInfo> ss=this.surveyLossInfoDao.selectAll(dispose_people_number);
        for (SurveyLossInfo s:ss
             ) {
            s.setReported_info(this.reportedInfoDao.queryById("10086"));
            s.setVerify_loss_info(this.verifyLossInfoDao.queryById("10086"));
        }
        return ss;
    }

    @Override
    public int updateSurveyLossInfo_surveyStatus(String survey_status,String claimmainid) {
        return this.surveyLossInfoDao.updateSurveyLossInfo_surveyStatus(survey_status,claimmainid);
    }

    @Override
    public String selectRecognizee(String claimmainid) {
        return this.surveyLossInfoDao.selectRecognizee(claimmainid);
    }

    @Override
    public int updateTasking_job_number(Integer dispose_people_number) {
        return this.surveyLossInfoDao.updateTasking_job_number(dispose_people_number);
    }

    @Override
    public SurveyLossInfo insert(SurveyLossInfo surveyLossInfo) {
        return null;
    }


    /**
     * 分页查询
     *
     * @param surveyLossInfo 筛选条件
     * @param pageRequest      分页对象
     * @return 查询结果
     */


    /**
     * 新增数据
     *
     * @param surveyLossInfo 实例对象
     * @return 实例对象
     */


    @Override
    public SurveyLossInfo update(SurveyLossInfo surveyLossInfo) {
        return null;
    }

    @Override
    public boolean deleteById(Integer surveylossid) {
        return false;
    }


}
